package com.twu.biblioteca;

/**
 * Created by aswathik on 6/18/14.
 */
public class Quit implements MenuItem{

    private String menuString;
    Quit() {
        menuString = "Quit";
    }
    public String getMenuString() {
        return menuString;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Quit quit = (Quit) o;

        if (!menuString.equals(quit.menuString)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return menuString.hashCode();
    }

    public MenuActionResult performMenuAction(UserInterface userInterface) {
        MenuActionResult menuActionResult = new MenuActionResult();
        menuActionResult.setMenuActionDetails(true, "Thank you for using Biblioteca!! Bye");
        userInterface.displayMenuActionResult(menuActionResult);
        return menuActionResult;
    }
}